ZF.add('class-options', function(Z) {
    var L = Z.Lang;

    Z.Options = {

        setOptions : function(options, defaults) {
            var self = this, ops = self.options = Z.merge({}, defaults || {}, self.options, options);

            if (self.addEvent) {
                for (var op in ops) {
                    if (L.isFunction(ops[op]) && /^on[A-Z]/.test(op)) {
                        self.addEvent(op, ops[op]);
                        delete ops[op];
                    }
                }
            }

            return self;
        }

    };

});